package com.ftg.learn.bus.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ftg.learn.bus.entity.Log;
import com.ftg.learn.bus.service.ILogService;
import com.ftg.learn.util.ResPageEntity;
import com.ftg.learn.util.SelectController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 操作记录表 前端控制器
 * </p>
 *
 * @author lalala
 * @since 2022-03-07
 */
@RestController
@RequestMapping("/bus/log")
@Api(tags = "操作记录管理功能列表")
public class LogController extends SelectController<Log, ILogService> {

    @GetMapping("/showLogAndPage")
    @ApiOperation(value = "根据操作名称来模糊查询")
    public ResPageEntity showLogAndPage(@RequestParam String lname, @RequestParam int page, @RequestParam int limit){
        Page<Log> p = new Page<>(page,limit);
        p.setRecords(super.service.showLog(lname,p));
        return new ResPageEntity(p);
    }

}
